<?php if (!defined('insite')) die("no access"); 

if (strlen($_SESSION["user"])>2)
{
global $config;
global $db;
$planame = $db->fetchrow($db->query("SELECT memb_name FROM MEMB_INFO Where memb___id='".substr($_SESSION["user"],0,10)."'")); 
?>
<script>
function oncharchange()
{
if(document.charselpan.selectedchar.value.length <= 10)
{document.charselpan.submit(); }
}
</script>
<table  align="center" valign="center" border="0" width='90%'  cellpadding="0" cellspacing="0" class='tableMain'>
<tr>
				<td align='center' class='utrstyle' ><?=login_head.$planame[0]?></td>
			</tr>
<?
if(chkc_char(validate($_SESSION["user"]))==1 && $config["m_type"]!=2)
	{?>
			 <tr>
				<td height='15' align='center'><p><?=upan_chose_char?></p>
				<form name='charselpan' method='POST' action='<?=$config["siteaddress"]?>/?p=usercp&up=chinfo'><select name='selectedchar' onChange='oncharchange();' class='combx' style='width:110px;'><option><?=login_chch?></option><?
				$mmm=$db->query("SELECT Name FROM character WHERE AccountID='".$_SESSION["user"]."'");
				$colvo =$db->numrows($db->query("SELECT Name FROM character WHERE AccountID='".$_SESSION["user"]."'"));
				for ($j=0;$j<$colvo;$j++)
				{
					$resultc = $db->fetchrow($mmm);
					echo "<option value=".$resultc[0]; if($_SESSION["character"]==$resultc[0]){echo " selected";} echo">".$resultc[0]."</option>";
				}
		echo "		</select></form>
				</td>
			</tr>";


	}
	else if(chkc_char(validate($_SESSION["user"]))<1) echo "<tr><td><span class='warnms'>".login_chr_null."</span></td></tr>";

		/*if($_GET["p"]=="wshop")
		{
			echo" <tr>
					<td height='15' align='center'>".lang_nav_Zen.": ".bankZ_show()." Zen<br>".lang_nav_wZen.": ".wareg_show()." Zen <br> Credits: ".cred_show()."</td>
				 </tr>";
		}
		*/?>	
			<tr >
				<td align='center' height='4'><?=getusrmenu()?></td>
			</tr>
			<tr >
				<td align='center' ><form name='outform' method='POST' action=''><input type='submit' value='<?=button_logout?>' name='usrout' class='t-button'></form></td>
			</tr>
			</table><?
			if (adm_check($_SESSION["user"])==1)
				 {
					?><br><table align='center' width="90%">
						  <tr>
							  <td height='15' align='center' class="tr"><?=a_titles?></td>
						  </tr>
						  <tr>
							<td><?=getadmenu()?></td>
						  </td>
						  </table><?
				 }
}